#include <sys/time.h>
#include "lm_comman.h"


 uint get_curr_time()
{
	struct timeval tv;
	gettimeofday(&tv, NULL);
	uint time =  tv.tv_sec +  tv.tv_usec / 1000000;
	
	return time;
}


char *convert_sec_to_str(long tm, char *dst)
{
	DO_CONDX(!tm, tm = time(NULL));
	
	struct tm *pTm = localtime((const time_t *)&tm);
	sprintf(dst, "%04d-%02d-%02dT%02d:%02d:%02d",
						pTm->tm_year+1900, pTm->tm_mon+1, pTm->tm_mday, pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
	return dst;
}

